import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class test20 {
    public static void main(String[] args) throws IOException {

        List<String> s = FileUtils.readLines(new File("data.txt"),"UTF-8");
        Set<Character> set=new HashSet<>();

        for (int i = 0; i <s.size() ; i++) {
            char[] chars = s.get(i).toCharArray();
            for (char aChar : chars) {
                set.add(aChar);
            }
        }

        FileUtils.writeLines(new File("result.txt"),set);

    }
}
